/**
 知识库接口
 **/
import { http } from "@/utils/http";

type ResultTable = {
  total?: number;
  data?: Array<any>;
};

/**
 知识库-事件记录接口
 **/
// 查询知识库-事件记录接口
export const queryEventRecord = (data?: object) => {
  return http.request<ResultTable>("post", "/erc/api/v1/eventRecord/pageEventRecords", {
    data
  });
};
// 获取知识库-事件记录详情接口
export const getEventRecord = (data?: object) => {
  return http.request("post", "/erc/api/v1/eventRecord/getEventRecordDetail", {
    data
  });
};
// 新增知识库-事件记录接口
export const addEventRecord = (data?: object) => {
  return http.request("post", "/erc/api/v1/eventRecord/saveEventRecord", {
    data
  });
};
// 编辑知识库-事件记录接口
export const editEventRecord = (data?: object) => {
  return http.request("post", "/erc/api/v1/eventRecord/updateEventRecord", {
    data
  });
};
// 删除知识库-事件记录接口
export const deleteEventRecord = (data?: object) => {
  return http.request("post", "/erc/api/v1/eventRecord/delEventRecord", {
    data
  });
};

/**
 知识库-应急处置卡接口
 **/
// 查询知识库-应急处置卡接口
export const queryEmergencyCard = (data?: object) => {
  return http.request<ResultTable>("post", "/erc/api/v1/emergencyCard/pageEventRecords", {
    data
  });
};
// 获取知识库-应急处置卡详情接口
export const getEmergencyCard = (data?: object) => {
  return http.request("post", "/erc/api/v1/emergencyCard/getEventRecordDetail", {
    data
  });
};
// 新增知识库-应急处置卡接口
export const addEmergencyCard = (data?: object) => {
  return http.request("post", "/erc/api/v1/emergencyCard/saveEventRecord", {
    data
  });
};
// 编辑知识库-应急处置卡接口
export const editEmergencyCard = (data?: object) => {
  return http.request("post", "/erc/api/v1/emergencyCard/updateEventRecord", {
    data
  });
};
// 删除知识库-应急处置卡接口
export const deleteEmergencyCard = (data?: object) => {
  return http.request("post", "/erc/api/v1/emergencyCard/delEventRecord", {
    data
  });
};

/**
 知识库-报警文档接口
 **/
// 查询知识库-报警文档接口
export const queryAlarmDocument = (data?: object) => {
  return http.request<ResultTable>("post", "/erc/api/v1/alarmDocument/pageAlarmDocuments", {
    data
  });
};
// 新增知识库-报警文档接口
export const addAlarmDocument = (data?: object) => {
  return http.request("post", "/erc/api/v1/alarmDocument/saveAlarmDocument", {
    data
  });
};
// 编辑知识库-报警文档接口
export const editAlarmDocument = (data?: object) => {
  return http.request("post", "/erc/api/v1/alarmDocument/updateAlarmDocument", {
    data
  });
};
// 删除知识库-报警文档接口
export const deleteAlarmDocument = (data?: object) => {
  return http.request("post", "/erc/api/v1/alarmDocument/delAlarmDocument", {
    data
  });
};

/**
 知识库-其他信息接口
 **/
// 查询知识库-其他信息接口
export const queryOtherInfo = (data?: object) => {
  return http.request<ResultTable>("post", "/erc/api/v1/otherInfo/pageOtherInfo", {
    data
  });
};
// 新增知识库-其他信息接口
export const addOtherInfo = (data?: object) => {
  return http.request("post", "/erc/api/v1/otherInfo/saveOtherInfo", {
    data
  });
};
// 编辑知识库-其他信息接口
export const editOtherInfo = (data?: object) => {
  return http.request("post", "/erc/api/v1/otherInfo/updateOtherInfo", {
    data
  });
};
// 删除知识库-其他信息接口
export const deleteOtherInfo = (data?: object) => {
  return http.request("post", "/erc/api/v1/otherInfo/delOtherInfo", {
    data
  });
};

/**
 知识库-故障经验管理接口
 **/
// 查询知识库-故障经验管理接口
export const queryFaultManage = (data?: object) => {
  return http.request<ResultTable>("post", "/erc/api/v1/faultManagement/pageFaultManagements", {
    data
  });
};
// 获取知识库-故障经验管理详情接口
export const getFaultManage = (data?: object) => {
  return http.request("post", "/erc/api/v1/faultManagement/getByEqpCodes", {
    data
  });
};
// 新增知识库-故障经验管理接口
export const addFaultManage = (data?: object) => {
  return http.request("post", "/erc/api/v1/faultManagement/saveFaultManagement", {
    data
  });
};
// 编辑知识库-故障经验管理接口
export const editFaultManage = (data?: object) => {
  return http.request("post", "/erc/api/v1/faultManagement/updateFaultManagement", {
    data
  });
};
// 删除知识库-故障经验管理接口
export const deleteFaultManage = (data?: object) => {
  return http.request("post", "/erc/api/v1/faultManagement/delFaultManagement", {
    data
  });
};
// 知识库-故根据故障类型获取工单接口
export const getByFaultType = (data?: object) => {
  return http.request("post", "/erc/api/v1/maintenanceWorkOrder/getByFaultType", {
    data
  });
};

// 维修工单-故障类型获取
export const getMaintainFaultType = (data?: object) => {
  return http.request("post", "/erc/api/v1/faultManagement/getFaultType", {
    data
  });
};
